package com.cmower.dzone.optional;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;

/**
 * @author 沉默王二，一枚有趣的程序员
 */
public class OptionalMapDemo {
    public static void main(String[] args) {
        String name = "沉默王二";
        Optional<String> nameOptional = Optional.of(name);
        Optional<Integer> intOpt = nameOptional
                .map(String::length);

        System.out.println( intOpt.orElse(0));
    }
}